﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Xml;

namespace WeiboFilter
{
    public class SystemConstant
    {
        private static Dictionary<string, double> _threshold = new Dictionary<string, double>();

        public static Dictionary<string,double> threshold
        {
            get { return _threshold; }
            private set { _threshold = value; }
        }
        /// <summary>
        /// 返回多少
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public static int importConfigureXML(string filename)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(filename);
            XmlNodeList nodelist = doc.SelectNodes("FilterSystem/YUZHIS/YUZHI");
            foreach (XmlNode node in nodelist)
            {
                threshold.Add(node.SelectSingleNode("name").InnerText, Convert.ToDouble(node.SelectSingleNode("value").InnerText));
            }

            return threshold.Count;
        }

    }
}